pydaddy with vector data

(This notebook assumes that you have gone through the Getting Started notebook.)

pydaddy also works with (2-dimensional) vector data. For a 2-D timeseries $(x(t), y(t))$, pydaddy attempts to fit the following model:

$$ \frac{dx}{dt} = A_1(x, y) + B_{11}(x, y) \cdot \eta_1(t) + B_{12}(x, y) \cdot \eta_2(t) \\ \frac{dy}{dt} = A_2(x, y) + B_{21}(x, y) \cdot \eta_1(t) + B_{12}(x, y) \cdot \eta_2(t) $$

where $B_{12} = B_{21}$. Here, $A_1$ and $A_2$ are the drift functions, $B_{11}$ and $B_{22}$ are the diffusion functions, and $B_{12} = B_{21}$ is the cross-diffusion term. As with the scalar case, pydaddy recovers $B^2_{11}, B^2_{22}$ and $B^2_{12}$.

Initializing the pydaddy object

Similar to the scalar analysis, we need to initialize a pydaddy object. In this case, data will be a two element list.

Recovering functional forms for drift and diffusion

There are 5 different functions, each of two variables: two drift functions ($A_1$ and $A_2$), two diffusion functions ($B^2_{11}$ and $B^2_{22}$) and a cross diffusion term ($B^2_{12} = B^2_{21}$). As with the 1D example, these can be fit by calling the ddsde.fit() function.

The coefficients in $B_{21}$ are negligible, i.e. $B_{21}$ is effectively 0. We can force pydaddy to ignore small coefficients by setting an appropriate sparity threshold manually instead of letting it automatically choose a threshold (see FITTING NOTEBOOK for further details).

Interactive plots for drift and diffusion

As with the 1D example, we can get interactive plots of drift and diffusion functions using ddsde.drift() and ddsde.diffusion(). For 2D, there is also the ddsde.cross_diffusion() function to get the cross-diffusion plot.

Diagnostics

As mentioned in the Getting Started notebook, pydaddy allows us to check if all underlying assumptions for fitting a drift-diffusion model are met. In case for 2D, the noise_diagnostics() functions creates the following plots: